Clean up build system some more. No need to explicitly
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Apr 2006 16:15:34 +0000 (17:15 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Apr 2006 16:15:34 +0000 (17:15 +0100)
include Rules.mk/Post.mk all over the place.

Signed-off-by: Keir Fraser <keir@xensource.com>
28 files changed:
xen/Makefile
xen/Post.mk [deleted file]
xen/Rules.mk
xen/acm/Makefile
xen/arch/ia64/Makefile
xen/arch/ia64/linux-xen/Makefile
xen/arch/ia64/linux/Makefile
xen/arch/ia64/vmx/Makefile
xen/arch/ia64/xen/Makefile
xen/arch/x86/Makefile
xen/arch/x86/acpi/Makefile
xen/arch/x86/cpu/Makefile
xen/arch/x86/cpu/mcheck/Makefile
xen/arch/x86/cpu/mtrr/Makefile
xen/arch/x86/genapic/Makefile
xen/arch/x86/hvm/Makefile
xen/arch/x86/hvm/svm/Makefile
xen/arch/x86/hvm/svm/x86_32/Makefile
xen/arch/x86/hvm/svm/x86_64/Makefile
xen/arch/x86/hvm/vmx/Makefile
xen/arch/x86/hvm/vmx/x86_32/Makefile
xen/arch/x86/hvm/vmx/x86_64/Makefile
xen/arch/x86/x86_32/Makefile
xen/arch/x86/x86_64/Makefile
xen/common/Makefile
xen/drivers/Makefile
xen/drivers/acpi/Makefile
xen/drivers/char/Makefile

index d7b458116c3d21d62b19bf6f33f237ef91da88be..c34445ac3700fc83749589dbabf43c0f4548999a 100644 (file)
@@ -1,27 +1,20 @@
-INSTALL                        = install
-INSTALL_DATA           = $(INSTALL) -m0644
-INSTALL_DIR            = $(INSTALL) -d -m0755
-
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
-export XEN_VERSION       = 3
-export XEN_SUBVERSION    = 0
-export XEN_EXTRAVERSION  = -unstable
-export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
-
-export BASEDIR          := $(CURDIR)
+export XEN_VERSION      := 3
+export XEN_SUBVERSION   := 0
+export XEN_EXTRAVERSION := -unstable
+export XEN_FULLVERSION  := $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 
-include Rules.mk
+export BASEDIR := $(CURDIR)
 
 default: build
-$(TARGET).gz: $(TARGET)
-       gzip -f -9 < $< > $@.new
-       mv $@.new $@
 
-debug: 
-       objdump -D -S $(TARGET)-syms > $(TARGET).s
+ifeq ($(XEN_ROOT),)
 
-dist: install
+build install clean:
+       make -f Rules.mk $@
+
+else
 
 build: $(TARGET).gz
 
@@ -38,24 +31,35 @@ install: $(TARGET).gz
        $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
        $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
 
-clean: delete-unfresh-files
+clean:: delete-unfresh-files
        $(MAKE) -C tools clean
-       $(MAKE) -C common clean
-       $(MAKE) -C drivers clean
-       $(MAKE) -C acm clean
-       $(MAKE) -C arch/$(TARGET_ARCH) clean
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C acm clean
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
        rm -f include/asm *.o $(TARGET)* *~ core
        rm -f include/asm-*/asm-offsets.h
        rm -f include/xen/acm_policy.h
 
+endif
+
+dist: install
+
+debug: FORCE
+       objdump -D -S $(TARGET)-syms > $(TARGET).s
+
+$(TARGET).gz: $(TARGET)
+       gzip -f -9 < $< > $@.new
+       mv $@.new $@
+
 $(TARGET): delete-unfresh-files
        $(MAKE) -C tools
-       $(MAKE) include/xen/compile.h
-       $(MAKE) include/xen/acm_policy.h
+       $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
+       $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/acm_policy.h
        [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
-       $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
-       $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
-       $(MAKE) -C arch/$(TARGET_ARCH) $(TARGET)
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
+       $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
 
 # drivers/char/console.o contains static banner/compile info. Blow it away.
 # Don't refresh these files during e.g., 'sudo make install'
@@ -115,7 +119,7 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
          echo ""; \
          echo "#endif") <$< >$@
 
-.PHONY: default debug install dist clean delete-unfresh-files TAGS tags
+.PHONY: default debug build install dist clean delete-unfresh-files TAGS tags
 
 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers 
 define all_sources
diff --git a/xen/Post.mk b/xen/Post.mk
deleted file mode 100644 (file)
index 02008ac..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# Ensure each subdirectory has exactly one trailing slash.
-subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
-subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
-
-# Add explicitly declared subdirectories to the object list.
-obj-y += $(patsubst %,%/built_in.o,$(subdir-y))
-
-# Add implicitly declared subdirectories (in the object list) to the
-# subdirectory list, and rewrite the object-list entry.
-subdir-y += $(filter %/,$(obj-y))
-obj-y    := $(patsubst %/,%/built-in.o,$(obj-y))
-
-subdir-all := $(subdir-y) $(subdir-n)
-
-built_in.o: $(obj-y)
-       $(LD) $(LDFLAGS) -r -o $@ $^
-
-.PHONY: FORCE
-FORCE:
-
-%/built_in.o: FORCE
-       $(MAKE) -C $*
-
-clean:: $(addprefix _clean_, $(subdir-all)) FORCE
-       rm -f *.o *~ core
-_clean_%/: FORCE
-       $(MAKE) -C $* clean
index 2639f6a1d1404b97be46c01e74b7bbf4d1b2fa59..66749058d3d171b376ca068588fdbcb11ab1bbe8 100644 (file)
@@ -33,6 +33,10 @@ HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
 
+INSTALL      := install
+INSTALL_DATA := $(INSTALL) -m0644
+INSTALL_DIR  := $(INSTALL) -d -m0755
+
 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
 
 # Do not depend on auto-generated header files.
@@ -63,6 +67,36 @@ ALL_OBJS := $(ALL_OBJS-y)
 CFLAGS   := $(strip $(CFLAGS) $(CFLAGS-y))
 AFLAGS   := $(strip $(AFLAGS) $(AFLAGS-y))
 
+include Makefile
+
+# Ensure each subdirectory has exactly one trailing slash.
+subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
+subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
+
+# Add explicitly declared subdirectories to the object list.
+obj-y += $(patsubst %,%/built_in.o,$(subdir-y))
+
+# Add implicitly declared subdirectories (in the object list) to the
+# subdirectory list, and rewrite the object-list entry.
+subdir-y += $(filter %/,$(obj-y))
+obj-y    := $(patsubst %/,%/built-in.o,$(obj-y))
+
+subdir-all := $(subdir-y) $(subdir-n)
+
+built_in.o: $(obj-y)
+       $(LD) $(LDFLAGS) -r -o $@ $^
+
+.PHONY: FORCE
+FORCE:
+
+%/built_in.o: FORCE
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
+
+clean:: $(addprefix _clean_, $(subdir-all)) FORCE
+       rm -f *.o *~ core
+_clean_%/: FORCE
+       $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
+
 %.o: %.c $(HDRS) Makefile
        $(CC) $(CFLAGS) -c $< -o $@
 
index a3656e905a13de1e5fd5c59351774e55fd8a2051..c16be20c3a80db1c330f82e9289ca9753fd694bf 100644 (file)
@@ -1,9 +1,5 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += acm_core.o 
 obj-y += acm_policy.o
 obj-y += acm_simple_type_enforcement_hooks.o
 obj-y += acm_chinesewall_hooks.o
 obj-y += acm_null_hooks.o
-
-include $(BASEDIR)/Post.mk
index 381c6d739b1a5a390ac076c034fc89bc0b6f0374..14db4f2fa9489a414586d40b2d6128f1c62fd198 100644 (file)
@@ -1,21 +1,17 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-y += xen
 subdir-y += vmx
 subdir-y += linux
 subdir-y += linux-xen
 
-include $(BASEDIR)/Post.mk
-
 $(TARGET)-syms: linux-xen/head.o $(ALL_OBJS) xen.lds.s
        $(LD) $(LDFLAGS) -T xen.lds.s -N \
                -Map map.out linux-xen/head.o $(ALL_OBJS) -o $@
        $(NM) -n $@ | $(BASEDIR)/tools/symbols > $(BASEDIR)/xen-syms.S
-       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
        $(LD) $(LDFLAGS) -T xen.lds.s -N \
                -Map map.out linux-xen/head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
        $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
-       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
        $(LD) $(LDFLAGS) -T xen.lds.s -N \
                -Map map.out linux-xen/head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
        rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
index f602f52c040d22cd19033ea8ff7c0b0a3179c981..ca5354b343c477ab9e31554594d7d5aa633f5411 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += efi.o
 obj-y += entry.o
 obj-y += irq_ia64.o
@@ -15,5 +13,3 @@ obj-y += time.o
 obj-y += tlb.o
 obj-y += unaligned.o
 obj-y += unwind.o
-
-include $(BASEDIR)/Post.mk
index b5f2c1dd47f1a91b0b0e877bcd5e79ab06a30cac..926fc501dfb7969873943ac6437358fd14847a25 100644 (file)
@@ -1,6 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
-
 obj-y += bitop.o
 obj-y += clear_page.o
 obj-y += cmdline.o
@@ -26,8 +23,6 @@ obj-y += __udivdi3.o
 obj-y += __moddi3.o
 obj-y += __umoddi3.o
 
-include $(BASEDIR)/Post.mk
-
 ## variants of divide/modulo
 ## see files in xen/arch/ia64/linux/lib (linux/arch/ia64/lib)
 __divdi3.o: idiv64.S
index 55322531b1c760a01116e1b0a6181b1c2859299a..df0a72f0fe8739ae4e66803b1c583c329f99c2f7 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += hvm_vioapic.o
 obj-y += mm.o
 obj-y += mmio.o
@@ -20,5 +18,3 @@ obj-y += vmx_vcpu.o
 obj-y += vmx_virt.o
 obj-y += vmx_vsa.o
 obj-y += vtlb.o
-
-include $(BASEDIR)/Post.mk
index 1d3d80b3474a7d030533057ff35bbb1753436bc0..600b010d1103e78471af506a0cdb099990a04eff 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += acpi.o
 obj-y += dom0_ops.o
 obj-y += domain.o
@@ -26,5 +24,3 @@ obj-y += xensetup.o
 obj-y += xentime.o
 
 obj-$(crash_debug) += gdbstub.o
-
-include $(BASEDIR)/Post.mk
index dee62f224a3c9c7e504bfad7607dea925c7046a0..fbb1a83c1f1d4e02049f88c01252f77b017077cf 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-y += acpi
 subdir-y += cpu
 subdir-y += genapic
@@ -50,8 +48,6 @@ obj-$(x86_64) += shadow.o shadow_public.o shadow_guest32.o shadow_guest32pae.o
 
 obj-$(crash_debug) += gdbstub.o
 
-include $(BASEDIR)/Post.mk
-
 $(TARGET): $(TARGET)-syms boot/mkelf32
        ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
        `$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
@@ -60,11 +56,11 @@ $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
        $(LD) $(LDFLAGS) -T xen.lds -N \
            boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@
        $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
-       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
        $(LD) $(LDFLAGS) -T xen.lds -N \
            boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
        $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
-       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
        $(LD) $(LDFLAGS) -T xen.lds -N \
            boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
        rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
index 6c0e68a8ace556cd8f89aca44888606b7e6ec337..123f174f0e7d5bcfe6c8b3991cb9490533afb743 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += boot.o
-
-include $(BASEDIR)/Post.mk
index bbb02cb719069a2e6f7804dcb983fdb9a92ce4e2..1fa37dbe7589b9c09d8deeb6266fe16c6e22295a 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-y += mcheck
 subdir-y += mtrr
 
@@ -12,5 +10,3 @@ obj-$(x86_32) += centaur.o
 obj-$(x86_32) += cyrix.o
 obj-$(x86_32) += rise.o
 obj-$(x86_32) += transmeta.o
-
-include $(BASEDIR)/Post.mk
index 7588c577b832597763b24d7c9fc75f7df3e2bc08..fbf8f0a1771c4d6dcebf0c5fe0e8fbf99c5263bc 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += k7.o
 obj-y += mce.o
 obj-y += non-fatal.o
@@ -7,5 +5,3 @@ obj-y += p4.o
 obj-y += p5.o
 obj-y += p6.o
 obj-y += winchip.o
-
-include $(BASEDIR)/Post.mk
index 972ddb7f4bfc5422c4a5bbb7fd62f96f513463f7..445138aa3c52c932426ebff26c3d32afedbf7ffb 100644 (file)
@@ -1,10 +1,6 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += amd.o
 obj-y += centaur.o
 obj-y += cyrix.o
 obj-y += generic.o
 obj-y += main.o
 obj-y += state.o
-
-include $(BASEDIR)/Post.mk
index ea51ead30ae7c2f02734806d08dd9f8d4cd83014..1fcc2b9edbcdcba4749194e2f0ae32c4d07277a8 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += bigsmp.o
 obj-y += default.o
 obj-y += delivery.o
@@ -7,5 +5,3 @@ obj-y += es7000.o
 obj-y += es7000plat.o
 obj-y += probe.o
 obj-y += summit.o
-
-include $(BASEDIR)/Post.mk
index 84759742b6750b467647faff34e775059596e7c9..7cde715116dbc15640ec6d1df6519e380d247e06 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-y += svm
 subdir-y += vmx
 
@@ -10,5 +8,3 @@ obj-y += io.o
 obj-y += platform.o
 obj-y += vioapic.o
 obj-y += vlapic.o
-
-include $(BASEDIR)/Post.mk
index 3e26b45e184f2760614db36d3dadd43660982e6f..e3baf066a079611f219026bf41031ef50ad6e49e 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-$(x86_32) += x86_32
 subdir-$(x86_64) += x86_64
 
@@ -8,5 +6,3 @@ obj-y += instrlen.o
 obj-y += intr.o
 obj-y += svm.o
 obj-y += vmcb.o
-
-include $(BASEDIR)/Post.mk
index 4191f3c4eb825d582849f1717a99cffe074c2acb..a9efb8f9e1e832223ca78075734a884fd253f0fd 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += exits.o
-
-include $(BASEDIR)/Post.mk
index 4191f3c4eb825d582849f1717a99cffe074c2acb..a9efb8f9e1e832223ca78075734a884fd253f0fd 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += exits.o
-
-include $(BASEDIR)/Post.mk
index 221e8aa694bff9fe60a498ab845ff46cb7fda818..3eede4303117804e53aedb2379b625964195727c 100644 (file)
@@ -1,10 +1,6 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-$(x86_32) += x86_32
 subdir-$(x86_64) += x86_64
 
 obj-y += io.o
 obj-y += vmcs.o
 obj-y += vmx.o
-
-include $(BASEDIR)/Post.mk
index 4191f3c4eb825d582849f1717a99cffe074c2acb..a9efb8f9e1e832223ca78075734a884fd253f0fd 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += exits.o
-
-include $(BASEDIR)/Post.mk
index 4191f3c4eb825d582849f1717a99cffe074c2acb..a9efb8f9e1e832223ca78075734a884fd253f0fd 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += exits.o
-
-include $(BASEDIR)/Post.mk
index 6d834de89b5f3ce83395d7303ed08a97abb4eafa..7b4ab46be6eca5f1c81506885e3bad1878a8cdd9 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += domain_page.o
 obj-y += entry.o
 obj-y += mm.o
@@ -7,5 +5,3 @@ obj-y += seg_fixup.o
 obj-y += traps.o
 
 obj-$(supervisor_mode_kernel) += supervisor_mode_kernel.o
-
-include $(BASEDIR)/Post.mk
index 82816f4ce53b6603165f4acccd0e28642380124d..3ce6d011566a7c792d720b25a2c244f7f05d6f94 100644 (file)
@@ -1,7 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += entry.o
 obj-y += mm.o
 obj-y += traps.o
-
-include $(BASEDIR)/Post.mk
index 6ea58895407466b251d893d8377f654f1af14080..d7bf1c50ec44eb6f09f2806b7de2e25ad1ea5366 100644 (file)
@@ -1,5 +1,3 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += acm_ops.o
 obj-y += bitmap.o
 obj-y += dom0_ops.o
@@ -28,7 +26,5 @@ obj-y += xmalloc.o
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
 
-include $(BASEDIR)/Post.mk
-
 # Object file contains changeset and compiler information.
 kernel.o: $(BASEDIR)/include/xen/compile.h
index b24da03f5e971afb2c54f4c3e723f6fcd66de345..ba39b440a989208b7aa26e4c763039b43d7ac7a2 100644 (file)
@@ -1,6 +1,2 @@
-include $(BASEDIR)/Rules.mk
-
 subdir-y += char
 subdir-$(HAS_ACPI) += acpi
-
-include $(BASEDIR)/Post.mk
index 88b7ad93a62aafecde672a406359e18beb62e704..68dafe3a526204cffea51f298b5ca0541bd6ea46 100644 (file)
@@ -1,5 +1 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += tables.o
-
-include $(BASEDIR)/Post.mk
index 40fc709764d68ec025e7eb1ce84b440a948a3ead..e63753d42927f7ce0aaa57a95ae7f1b0b6ea3124 100644 (file)
@@ -1,10 +1,6 @@
-include $(BASEDIR)/Rules.mk
-
 obj-y += console.o
 obj-y += ns16550.o
 obj-y += serial.o
 
-include $(BASEDIR)/Post.mk
-
 # Object file contains changeset and compiler information.
 console.o: $(BASEDIR)/include/xen/compile.h